package zcj.stu.interceptor;

import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import zcj.stu.scheduling.DynamicParamsConfig;

@Configuration
@EnableConfigurationProperties(DynamicParamsConfig.class)
public class Config implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(cacheInterceptor());
    }
    @Bean
    public Catch cacheInterceptor(){
        return new Catch();
    }
}
